<%
layout("/layouts/platform.html"){
%>
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-primary navbar-btn" href="${base}/platform/sys/conf" id="goback" data-pjax><i class="ti-angle-left"></i> 返回</a>
    </div>
</header>

<div class="content-wrap">
    <div class="wrapper" style="min-height:500px;">
        <section class="panel panel-form">
            <form id="addForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                  action="${base}/platform/sys/conf/editDo" method="post">
                <div class="row mb10">
                    <div class="col-lg-12">
                        <div class="form-group">
                            <label for="configKey" class="col-sm-2 control-label">配置项</label>

                            <div class="col-sm-8">
                                <input type="text" id="configKey" class="form-control" name="configKey" data-parsley-required="true"
                                       placeholder="key" value="${obj.configKey!}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="configValue" class="col-sm-2 control-label">参数值</label>

                            <div class="col-sm-8">
                                <input type="text" id="configValue" class="form-control" name="configValue" data-parsley-required="true"
                                       placeholder="value" value="${obj.configValue!}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="note" class="col-sm-2 control-label">说&nbsp;明</label>

                            <div class="col-sm-8">
                                <input type="text" id="note" class="form-control" name="note"
                                       placeholder="说明" value="${obj.note!}">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3"></div>
                <div class="col-lg-6">
                    <div class="form-group text-center">
                        <label></label>

                        <div>
                            <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
                        </div>
                    </div>
                </div>
            </form>
        </section>

    </div>
</div>
<script language="JavaScript">
    $(document).ready(function () {
        $('#addForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                form.find("button:submit").button("loading");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    //刷新父级菜单
                    setTimeout(function () {
                        $("#goback").trigger("click");
                    }, 1000);
                } else {
                    Toast.error(data.msg);
                }
                form.find("button:submit").button("reset");
            }
        });
    });
</script>


<%}%>